package com.nagarro.inventory;

/**
 * Represents manufactured items. Extends Item.
 * Final Cost for maufactured item includes
 * 12.5% tax_A and 2% tax_B
 * @author uditverma
 *
 */
public class ManufacturedItem extends Item {

	private static final float TAX_PERCENTAGE_B = .02f;			// 2%
	
	/* Calculate the final cost by adding 12.5% tax on price
	 * and then adding 2% tax on the calculated value. */
	@Override
	public double getTotal(final int quantity) {
		double cost = this.getCost(quantity);
		cost = cost + this.getTax(cost);
		cost = cost + getTaxB(cost);
		/* Calculate Tax */
		this.setTax(cost - this.getCost(quantity));
		return cost;
	}
	
	private double getTaxB(final double cost){
		return (cost * TAX_PERCENTAGE_B);
	}

}
